<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li>1</li>
    <li>1</li>
    <li>1</li>
    <li>1</li>
</ul>
<script>
    var ul = document.getElementsByTagName('ul');
    var lis = ul[0].getElementsByTagName('li');
    for (var i=0;i<lis.length;i++){
        // alert(lis[i]);
        var arr = lis[i];
        lis[i].onclick = function () {
            alert(lis[0]);
            alert(i);
            // alert(arr);
            // alert(this);
        }
    }
</script>
</body>
</html>